package com.taobao.tddl;

import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;

import com.taobao.tddl.atom.config.TAtomConfParser;
import com.taobao.tddl.atom.securety.impl.PasswordCoder;
import com.taobao.tddl.securety.PasswordCoderTaobaoImpl;

public class DecodeTest {

    public static void main(String[] args) throws InvalidKeyException, NoSuchPaddingException, NoSuchAlgorithmException, BadPaddingException, IllegalBlockSizeException {
        //System.out.println(TAtomConfParser.parserPasswd("encPasswd=6087644bd16f9bb5ae89c2f8fb5fddcb"));
        //System.out.println(DruidConfParser.parserPasswd("encPasswd=6087644bd16f9bb5ae89c2f8fb5fddcb"));
//        String pwd = "bSwrsOJmmSh6GS";
//        String encode1 = SecureIdentityLoginModule.encode(pwd);
//        System.out.println("encode" + encode1);
//        System.out.println(new String(new PasswordCoder().decode("28f45242d80b5212a37d2cf1f51b5e69")));
//        
//        System.out.println(new String(new PasswordCoder().encode("123456")));
//        
//        String decode3 = new String(SecureIdentityLoginModule.decode(encode1));
//        System.out.println("decode" + decode3);
//        String decode4 = TAtomConfParser.parserPasswd("encPasswd=-33fa2cefe2a97f3d91ecb368a16cd29a");
//        System.out.println("decode" + decode4);
//        System.out.println(new PasswordCoder().encode("haqiaolong-testt", "123456"));
        System.out.println(new PasswordCoderTaobaoImpl().encode("haqiaolong-testt", "123456"));
        System.out.println(new PasswordCoderTaobaoImpl().decode("haqiaolong-testt", "-21c157e3dd84d086"));
        //System.out.println(new PasswordCoder().decode("tddl-datax-diamd","-26f63155e2e7248475abc485c607159c"));
        
        //System.out.println(new PasswordCoder().decode("-173541009facaed7bf3ce3791caaba8c"));
        
        
        
        
        
        
    }

}
